package com.scfire.project

import java.util.Date;

import org.grails.databinding.BindingFormat

import com.scfire.project.Project
import com.scfire.security.Member

/**
 * Copyright 2015 Shudao Info Tech Co. Ltd.  All rights reserved.
 * @author lhzeng
 * @email zenglh@haoshudao.com
 * @date 2015年7月09日 上午11:33:12
 * @version V1.0
 */

class ProjectFeedback implements Comparable {

    //反馈内容
	String text
	//反馈图片1
	String img1
	//反馈图片2
	String img2
	//反馈图片3
	String img3
	//反馈图片4
	String img4
	//反馈图片5
	String img5
	//反馈图片6
	String img6
	//反馈图片7
	String img7
	//反馈图片8
	String img8
	
	//隐藏 false 显示 true
	boolean display_flag = true;
	
	//反馈类型    审核通过pass 、项目筹款满execute  中期反馈 fback 打款 payMent 结项报告 closeProject  项目执行中申请结项并通过显示/已结束over
	String feedbackType 
	
	//评论时间
	@BindingFormat('yyyy-MM-dd HH:mm:ss')
	Date   date
	
	int member
	
	int project
	
	//反馈用户和项目
	//static belongsTo = [member:Member,project:Project]

    static constraints = {
		text nullable:false
		img1 nullable:true
		img2 nullable:true
		img3 nullable:true
		img4 nullable:true
		img5 nullable:true
		img6 nullable:true
		img7 nullable:true
		img8 nullable:true
		
		date nullable:false
		
		feedbackType nullable:true
		
		member nullable:false
		project nullable:false
		display_flag nullable:true
    }
	
	public int compareTo(Object o) {
		try{
			date.compareTo(o?.date)
		}catch(Exception e){
			return 1
		}
	}
}
